

#pragma once

#include "zAdUi.h"
#include "zAcFdUi.h"

class UcTcUiSystemInternals;
class CUcFdUiFieldDialog;
class CUcFdUiFieldDialogHook;
class CUcFdUiImpFieldDialog;
class UcDbField;

class UCFDUI_PORT CUcFdUiFieldOptionDialog : public CZdUiDialog
{
    friend CUcFdUiFieldDialog;
    friend CUcFdUiImpFieldDialog;

    DECLARE_DYNAMIC(CUcFdUiFieldOptionDialog)

public:
    CUcFdUiFieldOptionDialog(CUcFdUiFieldDialogHook* pDialogHook, CUcFdUiFieldDialog* pFieldDlg, 
        UINT nIDTemplate, HINSTANCE hDialogResource = NULL);
    virtual ~CUcFdUiFieldOptionDialog();

    CUcFdUiFieldDialogHook* GetFieldDialogHook(void) const;
    CUcFdUiFieldDialog* GetFieldDialog      (void) const;
    virtual BOOL    Create                  (CWnd* pParent);

public:
    
    virtual BOOL    Create                  (LPCTSTR lpszTemplateName, 
                                             CWnd* pParent = NULL);
    virtual BOOL    Create                  (UINT nIDTemplate, 
                                             CWnd* pParent = NULL);

protected:
    virtual BOOL    OnSetActive             (void);
    virtual BOOL    OnKillActive            (void);
    virtual BOOL    OnFieldSelected         (UINT uNewFieldId);

protected:
    
    virtual void    OnOK                    (void);
    virtual void    OnCancel                (void);

protected:
    virtual void DoDataExchange(CDataExchange* pDX);
    afx_msg LRESULT OnFormatChanged         (WPARAM wParam,
                                             LPARAM lParam);
    afx_msg LRESULT OnBeginFormatExDialog   (WPARAM wParam,
                                             LPARAM lParam);
    afx_msg LRESULT OnEndFormatExDialog     (WPARAM wParam,
                                             LPARAM lParam);
    DECLARE_MESSAGE_MAP()

protected:
    void            *   mpImpObj;

private:
    friend class UcFdUiSystemInternals;    
};
